#ifndef QUERYRESULT_H
#define QUERYRESULT_H
#define DEBUG 0
#include<iostream>
using std::cout;using std::endl; using std::string;
#include<vector>
using std::vector;
#include<set>
#include<memory>
using std::shared_ptr; 
struct Sentence;
class QueryResult{  //查询结果类
    public: 
        QueryResult(string word,shared_ptr<std::set<int>> sp,shared_ptr<vector<Sentence>> file)
        :word_(word),idxs_(sp),file_(file){}; 
        std::set<int>::iterator begin(){return idxs_->begin();}
        std::set<int>::iterator end(){return idxs_->end();}
        void print();        //打印词的涉及句子
        shared_ptr<vector<Sentence>> get_file(){ return file_;}
    private:
        string word_;    //所查询的单词
        shared_ptr<std::set<int>> idxs_;    //所查词出现的句子序号
        shared_ptr<vector<Sentence>> file_;   //原文本
        vector<string> processWord(const string &); //处理结合查询结果
        void highlightAt( string &,const string &); //针对句子的某个单词高亮
};


#endif